package efuliBusiness.efuliApi;

import com.alibaba.fastjson.JSONObject;

/**
 * Created by yangxianming on 2018/5/24.
 * 接口数据的方法是提示用户接口数据的创建方式，并返回相关的数据。
 * 并不需要强制使用
 * 参数字段强制存在
 */
public class CashvoucherSetData {
//    private JSONObject packageData(String methodName){
//        JSONObject jsonObject = new JSONObject();
//        try {
//            Class c = Class.forName(this.getClass().getName());
//            Method[] method = c.getDeclaredMethods();
//            for (Method m: method){
//                if (Objects.equals(m.getName(), methodName)){
//                    for (Parameter p: m.getParameters()){
//                        jsonObject.put(p.getName(), "");
//                    }
//                }
//            }
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return jsonObject;
//    }

    public JSONObject efuli_cashvoucher_freeze_data(String request_id, String product_no, String quantity, String auto_unfreeze, String alipay_user_id){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("product_no", product_no);
        jsonObject.put("quantity", quantity);
        jsonObject.put("auto_unfreeze", auto_unfreeze);
        jsonObject.put("alipay_user_id", alipay_user_id);
        return jsonObject;
    }
    public JSONObject efuli_cashvoucher_unfreeze_data(String request_id, String freeze_trade_id, String alipay_user_id){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("freeze_trade_id", freeze_trade_id);
        jsonObject.put("alipay_user_id", alipay_user_id);
        return jsonObject;
    }
    public JSONObject efuli_cashvoucher_send_data(String request_id, String freeze_trade_id, String alipay_user_id, String notify_url){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("freeze_trade_id", freeze_trade_id);
        jsonObject.put("alipay_user_id", alipay_user_id);
        jsonObject.put("notify_url", notify_url);
        return jsonObject;
    }
    public JSONObject efuli_cashvoucher_query_data(String request_id, String voucher_id, String send_request_id, String ali_token){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("voucher_id", voucher_id);
        jsonObject.put("send_request_id", send_request_id);
        jsonObject.put("ali_token", ali_token);
        return jsonObject;
    }
    public JSONObject efuli_cashvoucher_directsend_data(String request_id, String product_no, String quantity,
                                                        String alipay_user_id, String receiving_absolute_time,
                                                        String receiving_validity_seconds, String gen_ali_token,
                                                        String send_channel, String send_channel_logo,
                                                        String send_desc, String notify_url){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("product_no", product_no);
        jsonObject.put("quantity", quantity);
        jsonObject.put("alipay_user_id", alipay_user_id);
        jsonObject.put("receiving_absolute_time", receiving_absolute_time);
        jsonObject.put("receiving_validity_seconds", receiving_validity_seconds);
        jsonObject.put("gen_ali_token", gen_ali_token);
        jsonObject.put("send_channel", send_channel);
        jsonObject.put("send_channel_logo", send_channel_logo);
        jsonObject.put("send_desc", send_desc);
        jsonObject.put("notify_url", notify_url);
        return jsonObject;
    }
    public JSONObject efuli_cashvoucher_dailybill_data(String request_id, String bill_date, String bill_type){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("request_id", request_id);
        jsonObject.put("bill_date", bill_date);
        jsonObject.put("bill_type", bill_type);
        return jsonObject;
    }
}
